import React from 'react'
// useLocation：得到location对象  search字符串  state
// useHistory：得到history对象   编程式导航
// useParams: 得到params数据 动态路由参数
import { useLocation, useHistory, useParams } from 'react-router-dom'

const Form = props => {
  // console.log('login', props)
  // console.log(props.location.search)

  const location = useLocation()
  const history = useHistory()
  const params = useParams()

  console.log(location, history, params)

  return (
    <div>
      <button
        onClick={() => {
          history.push('/rd')
        }}
      >
        去rd页面
      </button>
    </div>
  )
}

export default Form
